package com.hqyj.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@TableName("title_information")
public class TitleInformation extends MyPage implements Serializable {
    //主键
    //编号
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    //TableField 非主键的注解 ，定义的属性和列名的映射关系
    //员工姓名
    @TableField(value = "name")
    private String  name;

    //员工编号
    @TableField(value = "employee_id")
    private String employeeId;

    //员工职称
    @TableField(value = "title")
    private String  title;

    //员工入职时间
    @TableField(value = "entry_time")
    private Date entryTime;


    public String getentryTime() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if(this.entryTime!=null){
            return sdf.format(this.entryTime);
        }
        return "";
    }

    public void setentryTime(String entryTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            this.entryTime = sdf.parse(entryTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }


}
